<template>
  <div>
    <div class="app-container">
      <el-page-header content="添加小程序合集" @back="$router.go(-1)" />
    </div>
    <div class="app-container">
      <el-alert title="说明" description="当前为创建小程序合集，合集中会包含并兼容不同应用的小程序，方便用户管理" type="error" class="u-m-b-20" />
      <dk-form-create :form-data="formData" @submit="onSubmit" />
    </div>
  </div>
</template>

<script>
import { getAppCreateForm } from '@/api/platform/app'

export default {
  components: {
  },
  data() {
    return {
      formData: null
    }
  },
  mounted() {
    this.getappCreateForm()
  },
  methods: {
    getappCreateForm() {
      getAppCreateForm().then(res => {
        this.formData = res.data
      })
    },
    onSubmit(formData, res) {
      this.$msgbox.confirm('创建成功,是否跳转到平台').then(() => {
        this.$router.push('/app?p=' + res.data.plaid)
      }).catch(() => {})
    }
  }
}
</script>

<style scoped>

</style>
